﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DeployGames.TweenEngine
{
    /// <summary>
    /// .Net not implement anonymous interfaces.
    /// </summary>
    public class TimelinePoolCallback : Callback<Timeline>
    {

        public override void onPool(Timeline obj)
        {
            obj.reset();
        }

        public override void onUnPool(Timeline obj)
        {
            obj.reset();
        }
    }

    /// <summary>
    /// .Net not implement anonymous interfaces.
    /// </summary>
    public class TimelinePool : Pool<Timeline>
    {
        public TimelinePool(int initCapacity, Callback<Timeline> callback)
            : base(initCapacity, callback)
        {
        }

        protected override Timeline create()
        {
            return new Timeline();
        }
    }

    /// <summary>
    /// .Net not implement anonymous interfaces.
    /// </summary>
    public class TweenPoolCallback : Callback<Tween>
    {
        public override void onPool(Tween obj)
        {
            obj.reset();
        }
        public override void onUnPool(Tween obj)
        {
            obj.reset();
        }
    }

    /// <summary>
    /// .Net not implement anonymous interfaces.
    /// </summary>
    public class TweenPool : Pool<Tween>
    {
        public TweenPool(int initCapacity, Callback<Tween> callback)
            : base(initCapacity, callback)
        {
        }

        protected override Tween create()
        {
            return new Tween();
        }
    }
}
